package com.hurr.service.impl;

import java.util.Collection;

import com.hurr.bo.User;
import com.hurr.dao.UserDao;
import com.hurr.service.UserService;

/**
 * Implemetation for User Service
 * 
 * @author Fernando Perelli
 * 
 */
public class UserServiceImpl implements UserService {

	/**
	 * Dao for user
	 */
	private UserDao userDao;

	/**
	 * Set UserDao
	 * 
	 * @param userDao
	 */
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.hurr.service.UserService#save(com.hurr.bo.User)
	 */
	@Override
	public User save(User user) {
		return userDao.save(user);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.hurr.service.UserService#update(com.hurr.bo.User)
	 */
	@Override
	public void update(User user) {
		userDao.update(user);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.hurr.service.UserService#delete(com.hurr.bo.User)
	 */
	@Override
	public void delete(User User) {
		userDao.delete(User);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.hurr.service.UserService#findById(java.lang.Long)
	 */
	@Override
	public User findById(Long id) {
		return userDao.findById(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.hurr.service.UserService#findAll()
	 */
	@Override
	public Collection<User> findAll() {
		return userDao.findAll();
	}

}
